<?php
session_start();
ob_start();
include_once 'include/common.php';
$core = new core();
if (!$core->CheckLogin()) {
    header('Location:login.php');
}
$load_more = 0;
$total = 0;
$category_id = 0;
$list_product = $core->getCrawlProductListByCategory($category_id,1, $load_more,$total);
$list_category = $core->getListCrawlCategoryByLevel(1);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <!--
            Charisma v1.0.0

            Copyright 2012 Muhammad Usman
            Licensed under the Apache License v2.0
            http://www.apache.org/licenses/LICENSE-2.0

            http://usman.it
            http://twitter.com/halalit_usman
    -->
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta http-equiv="content-language" content="vi"/>
    <title>Zen store</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
    <meta name="author" content="Muhammad Usman">

    <!-- The styles -->
    <link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
    </style>
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/charisma-app.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">

    <link href='css/chosen.css' rel='stylesheet'>
    <link href='css/uniform.default.css' rel='stylesheet'>

    <link href='css/jquery.cleditor.css' rel='stylesheet'>


    <link href='css/jquery.iphone.toggle.css' rel='stylesheet'>

    <link href='css/uploadify.css' rel='stylesheet'>

    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- The fav icon -->
    <link rel="shortcut icon" href="img/favicon.ico">

</head>

<body>
<div id="page-wrap" class="page-wrap body-wrap ">
    <div id="page-tray" class="tray transition">
        <?php include_once ('new_menu.php'); ?>

        <div id="page-content" class="page-content transition profile-page">
            <?php include_once ('navbar.php'); ?>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div id="content" class="span12">
                        <!--                                <div>
                                                            <ul class="breadcrumb">
                                                                <li>
                                                                    <a href="#">Home</a> <span class="divider">/</span>
                                                                </li>
                                                                <li>
                                                                    <a href="#">Tables</a>
                                                                </li>
                                                            </ul>
                                                        </div>-->
                        <div class="row-fluid">
                            <div class="span12">
<!--                                <div  class="dataTables_length">-->
<!--                                    <input type="hidden" name="filter" id="status_search" value="0">-->
<!--                                    <input style="width: 300px; margin: 10px 0px 0px 0px;" type="text" name="filter_search_product" id="filter_search_product" value="Tìm theo tên hoặc mã sản phẩm" >-->
<!--                                    <a href="javascript:void(0)" class="btn btn-success" id="btn_search_product" style=" margin: 10px 0px 0px 0px;">-->
<!--                                        <i class="icon-zoom-in icon-white"></i>-->
<!--                                        Search-->
<!--                                    </a>-->
<!--                                    <button style=" margin: 10px 0px 0px 0px;" type="button" class="btn reset_search" id="reset_search">Cancel</button>-->
<!--                                </div>-->
                                <h2>Tìm thấy tổng số: <span id="total_product"><?php echo $total;?></span> sản phẩm</h2>
                                    <p>Chọn mục sản phẩm:</p>
                                    <select class="selectpicker mrk_select_crawl_category">
                                        <option value="0">Chọn mục sản phẩm</option>
                                        <?php
                                        if($list_category){
                                            foreach($list_category as $category){
                                                ?>
                                                <option value="<?php echo $category->id;?>"><?php echo $category->nav_name;?></option>
                                        <?php
                                            }
                                        }
                                        ?>


                                    </select>
                            </div>

                        </div>
                        <div class="row-fluid sortable">
                            <div class="box span12">
                                <div class="box-header well" data-original-title>
                                    <h2><i class="icon-user"></i> Danh sách sản phẩm</h2>
                                    <div class="box-icon">
                                        <!--                        <a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>-->
                                        <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
                                        <!--                        <a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>-->
                                    </div>
                                </div>
                                <div class="box-content">
                                    <input type="hidden" name="loadmore_product" id="loadmore_product" value="<?php echo $load_more; ?>">
                                    <input type="hidden" name="page_product" id="page_product" value="1">

                                    <table class="table table-striped table-bordered bootstrap-datatable datatable">
                                        <thead>
                                        <tr>
                                            <th>Product Name/Code</th>
                                            <th>Main photo</th>
                                            <th>Extra photo</th>
                                            <th>AT / PT</th>
                                            <th>Product Size</th>

                                            <th>Product Color</th>

                                        </tr>
                                        </thead>
                                        <tbody id="tbody_product_list">
                                        <?php
                                        if ($list_product) {
                                            foreach ($list_product as $product) {
                                                ?>
                                                <tr>
                                                    <td>
                                                        <?php echo $product->product_name; ?>
                                                        <p><?php echo $product->product_code; ?></p>
                                                        <p><a href="<?php echo $product->link_web; ?>">Link web</a></p>
                                                    </td>
                                                    <td class="center">
                                                        <img class="photo_product" style="width: 100px;" src="tmp_photo_crawl/<?php echo $product->thumb_main_photo; ?>" rel="tmp_photo_crawl/<?php echo $product->main_photo; ?>"/>
                                                    </td>
                                                    <td class="center">
                                                        <?php
                                                        $list_extra_photo = explode(",",$product->thumb_extra_photo);
                                                        foreach($list_extra_photo as $extra_photo){
                                                            if($extra_photo!=''){
                                                        ?>
                                                                <img class="photo_product" style="width: 50px;" src="tmp_photo_crawl/<?php echo $extra_photo; ?>" rel="tmp_photo_crawl/<?php echo $extra_photo; ?>"/>
                                                        <?php
                                                            }
                                                        }
                                                        ?>
                                                    </td>
                                                    <td class="center">
                                                        <?php echo $product->stamp_price." / ".$product->store_price; ?>
                                                    </td>
                                                    <td class="center"><?php echo $product->product_size; ?></td>

                                                    <td class="center"><?php echo $product->product_color; ?></td>

                                                </tr>
                                            <?php
                                            }
                                        }
                                        ?>
                                        </tbody>
                                    </table>
                                    <div id="loading" style="display:none;width: 220px; height: 19px;margin: 0 auto;"><img title="img/ajax-loaders/ajax-loader-7.gif" src="img/ajax-loaders/ajax-loader-7.gif"></div>
                                </div>
                            </div><!--/span-->
                        </div><!--/row-->
                    </div><!--/fluid-row-->
                    <?php include_once ('footer.php'); ?>
                </div><!--/.fluid-container-->
            </div>
        </div>
    </div>
</div>
<!-- hien thi ảnh sp phóng to-->
<div class="modal hide fade" id="modal_photo_zoom">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h3>Choose Image</h3>
    </div>
    <div class="modal-body" id="photo_zoom">

    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Close</a>

    </div>
</div>
<!-- external javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

<!-- jQuery -->
<script src="js/jquery-1.7.2.min.js"></script>
<!-- jQuery UI -->
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<!-- transition / effect library -->
<script src="js/bootstrap-transition.js"></script>
<!-- alert enhancer library -->
<script src="js/bootstrap-alert.js"></script>
<!-- modal / dialog library -->
<script src="js/bootstrap-modal.js"></script>
<!-- custom dropdown library -->
<script src="js/bootstrap-dropdown.js"></script>
<!-- scrolspy library -->
<!--	<script src="js/bootstrap-scrollspy.js"></script>-->
<!-- library for creating tabs -->
<script src="js/bootstrap-tab.js"></script>
<!-- library for advanced tooltip -->
<script src="js/bootstrap-tooltip.js"></script>
<!-- popover effect library -->
<script src="js/bootstrap-popover.js"></script>
<!-- button enhancer library -->
<!--	<script src="js/bootstrap-button.js"></script>-->
<!-- accordion library (optional, not used in demo) -->
<script src="js/bootstrap-collapse.js"></script>
<!-- carousel slideshow library (optional, not used in demo) -->
<!--	<script src="js/bootstrap-carousel.js"></script>-->
<!-- autocomplete library -->
<!--	<script src="js/bootstrap-typeahead.js"></script>-->
<!-- tour library -->
<!--	<script src="js/bootstrap-tour.js"></script>-->
<!-- library for cookie management -->
<script src="js/jquery.cookie.js"></script>
<script src='js/jquery.dataTables.min.js'></script>
<!-- calander plugin -->
<!--	<script src='js/fullcalendar.min.js'></script>
 data table plugin
-->

<!-- chart libraries start -->
<!--	<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.min.js"></script>
<script src="js/jquery.flot.pie.min.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>-->
<!-- chart libraries end -->

<!-- select or dropdown enhancer -->
<script src="js/jquery.chosen.min.js"></script>
<!-- checkbox, radio, and file input styler -->
<script src="js/jquery.uniform.min.js"></script>
<!-- plugin for gallery image view -->
<!--	<script src="js/jquery.colorbox.min.js"></script>-->
<!-- rich text editor library -->
<script src="js/jquery.cleditor.min.js"></script>
<!-- notification plugin -->
<!--	<script src="js/jquery.noty.js"></script>-->
<!-- file manager library -->
<!--	<script src="js/jquery.elfinder.min.js"></script>-->
<!-- star rating plugin -->
<!--	<script src="js/jquery.raty.min.js"></script>-->
<!-- for iOS style toggle switch -->
<script src="js/jquery.iphone.toggle.js"></script>
<!-- autogrowing textarea plugin -->
<script src="js/jquery.autogrow-textarea.js"></script>
<!-- multiple file upload plugin -->
<script src="js/jquery.uploadify-3.1.min.js"></script>
<!-- history.js for cross-browser state change on ajax -->
<script src="js/jquery.history.js"></script>
<!-- application script for Charisma demo -->
<script src="js/common.js?t=1"></script>
<script src="js/crawlProductList.js?t=1"></script>



</body>
</html>


